package com.sun.services.roles.service;


import com.sun.commons.base.R;
import com.sun.dto.users.RoleDto;
import com.sun.dto.users.RoleSearchModel;
import org.springframework.data.domain.Page;

import java.util.List;

public interface RoleService {

    R createRole(RoleDto dto);

    R updateRole(RoleDto dto);

    R deleteRole(Long id);

    /**
     * 刷新角色权限缓存
     *
     * @param id
     * @return
     */
    R refreshPermissionCache(Long id);

    /**
     * 获取角色权限缓存
     *
     * @param roleCode
     * @return
     */
    String[] getPermissionCache(String roleCode);

    List<RoleDto> getList(RoleSearchModel model);
    Page<RoleDto> getPage(RoleSearchModel model);

}
